1. Field of the Invention
The present invention relates to an imaging apparatus, method for controlling imaging apparatus and computer-readable storage medium.
2. Description of the Related Art
In solid-state image sensing devices such as CCD sensors or CMOS sensors, there is a dark current signal that is output even while not emitting light. The effect of this dark current signal on a captured image can be corrected by removing, from the captured image, an image captured while no light is being emitted. Such a dark current includes a component that varies depending on the time, and thus more appropriate correction is possible by obtaining the dark current signal and an image signal while light is being emitted at the same time. In order to do so, a real-time dark current correction method is used in which a part of the solid-state image sensing device is shielded from light to provide a region that is not irradiated with light (optical black region (hereinafter, referred to as a “light shielded region”)), and a dark current signal and an image signal are obtained at the same time.
In the light shielded region, however, a dark current of pixels having a small pixel value is generally read, and thus this region is significantly affected by noise. Also, in a CCD or CMOS sensor, a system-on-chip in a lamination structure can be formed such that a scanning circuit such as a shift register is formed on a solid-state image sensing device, and thus the scanning circuit can be formed directly below or above pixels. In such a case, however, pixels in a predetermined line above or below the scanning circuit may be affected by the heat of the scanning circuit, and the dark current may significantly vary.
In order to eliminate or reduce the effect of noise from the dark current signal, Patent Document 1 (Japanese Patent Laid-Open No. 2006-41935) discloses a method using a smoothing processing, a median processing, or the like. Patent Document 2 (Japanese Patent Laid-Open No. 2004-15712) discloses a method for reducing noise in a dark current by obtaining an average of light shielded regions for each line.
However, in the method disclosed in Patent Document 1, values of dark currents of pixels including a specific line (the specific line is assumed to be a vertical line for the sake of explanation) that significantly differs from other light shielded pixel lines due to the effect of the heat are smoothed in a lateral direction by an averaging processing or a median processing. Therefore, the dark current value of the specific line collapses, and it is not possible to correctly assume the dark current in the specific line, which may cause the situation in which appropriate dark current correction is not possible with respect to the pixel value in the specific line. Also, in the method disclosed in Patent Document 2, since smoothing is not performed in a lateral direction, variation due to noise in the lateral direction may directly be added to the dark current value.